﻿
CREATE PROCEDURE [dbo].[proc_Receipt_Getlist_ByOrderId]
	(
		@Oid  uniqueidentifier
		
	)
AS
Begin


Select ROW_NUMBER() OVER (ORDER BY RDate desc,ldate desc )AS Row,
	id,
		[CompanyId]
		,[CompanyName]
      ,[CusName]
      ,[OrderId]
      ,[NOE_Flag]
      ,[Je]
      ,[RDate]
      ,[Memo]
      ,[LDate]
      ,[LUserName]
      ,[LEName]
      ,[Flag]
      ,isnull([CancelDate],'1900-1-1') as [CancelDate]
      ,[CancelUserName]
      ,[CancelEName]
		From Receipt 
		Where [OrderId]=@Oid
order by RDate desc,ldate desc 
	


End